﻿<Window x:Class="SimpleWpfExample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow"
        Height="469"
        Width="682"
        DataContext="{Binding Main, Source={StaticResource Locator}}">
    
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Skins/MainSkin.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <DataTemplate x:Key="BookItemTemplate">
                <StackPanel x:Name="LayoutRoot">
                    <DockPanel x:Name="Header">
                        <Label x:Name="Title" Style="{DynamicResource SimpleLabel}" VerticalAlignment="Top" Content="{Binding Title}" FontSize="14.667" FontWeight="Bold"/>
                        <Button Content="Buy" Style="{DynamicResource SimpleButton}" Width="75" Command="{Binding BuyCommand, Mode=OneWay}"/>
                    </DockPanel>
                    <Label x:Name="Description" Content="{Binding Description}"/>
                </StackPanel>
            </DataTemplate>
        </ResourceDictionary>
    </Window.Resources>

    <Grid x:Name="LayoutRoot" ShowGridLines="True">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <StackPanel x:Name="Header" Background="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" Orientation="Horizontal">
            <Label Content="Current user:" Style="{DynamicResource SimpleLabel}"/>
            <Label Style="{DynamicResource SimpleLabel}" Margin="5,0,0,0"/>
        </StackPanel>
        <ListView ItemTemplate="{DynamicResource BookItemTemplate}" ItemsSource="{Binding Books}" />
    </Grid>
</Window>
